package org.brisling.oa.service;

import org.brisling.base.domain.ListDomain;
import org.brisling.base.domain.RetDomain;
import org.brisling.common.ConstSysParam;
import org.brisling.oa.domain.OAEquipmentPurchaseSub;
import org.brisling.oa.repository.OAEquipmentPurchaseSubRepo;
import org.brisling.oa.service.base.BaseOaSubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/oaEquipmentPurchaseSub")
/**
 * 高值耗材子表耗材信息服務service
 * @Author : jackson wang
 * @Date   : 2016年1月25日 下午4:18:01
 * @version: 1.0
 */
public class OAEquipmentPurchaseSubService extends BaseOaSubService<OAEquipmentPurchaseSub>{
	
			
	@SuppressWarnings("unused")
	@Autowired
	private OAEquipmentPurchaseSubRepo baseSubRepo;	
		
	
	public OAEquipmentPurchaseSubService(){
		this.clazz = OAEquipmentPurchaseSub.class;
		this.moduleName = ConstSysParam.MODULE_OA_EQUIPMENTSPURCHASESUB;		
	}	
	
	/**
	 * 保存耗材信息子表数据集合
	 * @param mainId	主表记录id
	 * @param jsonData	耗材信息子表数据集合
	 */
	@RequestMapping("/saveList.action")	
	public RetDomain saveList(@RequestParam(value="mainId",required=false)Long mainId,@RequestParam(value="jsonData",required=false)String jsonData){
		return super.saveList(mainId, jsonData);
	}
	
	/**
	 * 分页查询耗材子表数据集合
	 * @param mainId
	 * @param page
	 * @param rows
	 * @return
	 */
	@RequestMapping("/getListDomain.action")
	public ListDomain<OAEquipmentPurchaseSub> getListDomain(
			@RequestParam(value="page",required=false) String page,
			@RequestParam(value="rows",required=false) String rows,
			@RequestParam(value="mainId",required=false) Long mainId){
		
		return super.getPagedListDomainByMainId(mainId, page, rows);
		
			
	}
}
